import Axios from "@/utils/request.ts";
import {
  CustomerConfigListRes,
  GetMediaConfigListRes,
  GameActRewardNumRes,
  GetInstallGuideConfigRes,
  GetgroupClustersRes,
} from "@/types/user.ts";
export const HomeAxios = {
  // 获取游戏列表
  gameList(params: { groupId: number; pageNo: number; pageSize: number }): Promise<{
    code: 0;
    list: [];
    total: 0;
  }> {
    return Axios.post("hall/v1/game/list", params);
  },
  //登录游戏
  getGameUrl(params: { providerId: number; gameId: number; Lang: string }): Promise<{
    code: number;
    url: string;
  }> {
    return Axios.post("/hall/v1/game/login", params);
  },
  //获取游戏商的token
  getGameToken(parems: { providerId: number; op: number }): Promise<{
    code: number;
    token: string;
  }> {
    return Axios.post("/hall/v1/game/getTempToken", parems);
  },
  //上分充值
  gameRecharge(parems: { providerId: number; money: string; token: string }): Promise<{
    code: number;
    money: string;
  }> {
    return Axios.post("/hall/v1/game/inScore", parems);
  },
  //查询分数《遗弃》
  getQueryScore(parems: { providerId: number }): Promise<{
    code: number;
    totalMoney: string;
    freeMoney: string;
  }> {
    return Axios.post("/hall/v1/game/queryScore", parems);
  },
  //查询可提现的分数《遗弃》
  getOutScore(parems: { providerId: number }): Promise<{
    code: number;
    money: string;
  }> {
    return Axios.post("/hall/v1/game/outScore", parems);
  },
  //查询可提现的分数并下分
  queryBalance(): Promise<{
    code: number;
    balance: number;
    providerId?: number;
    gameId?: number;
    withdrawDama: number;
  }> {
    return Axios.post("/hall/v1/game/queryBalance");
  },
  //查询游戏注单记录
  queryGameOrderRecord(params: { pageNo: number; pageSize: number; timeType: number }) {
    return Axios.post("hall/v1/game/queryGameOrderRecord", params);
  },
  //查询游戏注单记录详情
  queryGameOrderRecordDetail(params: {
    pGameIDStr: string;
    pageNo: number;
    pageSize: number;
    timeType: number;
  }) {
    return Axios.post("/hall/v1/game/queryGameOrderRecordDetail", params);
  },
  // 获取首页banner配置列表
  getHomepageBannerConfigList(parems: { advId: string }) {
    return Axios.post("/hall/v1/settings/getHomepageBannerConfigList", parems);
  },
  //轮播图广告信息
  getLunBoConfigList(): Promise<{ list: [] }> {
    return Axios.post("/hall/v1/settings/getLunBoConfigList");
  },
  //首充活动配置表
  getActFirstRechargeConfig(): Promise<{ list: [] }> {
    return Axios.post("/hall/v1/act/getActFirstRechargeConfig");
  },
  //获取客服配置列表
  getCustomerConfigList(): Promise<CustomerConfigListRes[]> {
    return Axios.post("/hall/v1/settings/getCustomerConfigList");
  },
  //获取主页媒体配置列表
  getMediaConfigList(): Promise<GetMediaConfigListRes> {
    return Axios.post("/hall/v1/settings/getMediaConfigList");
  },
  //获取底部文案配置
  getFooterOfficialConfig(): Promise<{ content: string }> {
    return Axios.post("/hall/v1/settings/getFooterOfficialConfig");
  },
  //前端获取VAPID公钥
  getUserPwaServerKeys(): Promise<{ code: number; msg: string; serverKey: string }> {
    return Axios.post("/hall/v1/user/getUserPwaServerKeys");
  },
  //用户上报 pwa subscription
  addUserPwaSub(parems: { subscription: string }) {
    return Axios.post("/hall/v1/user/addUserPwaSub", parems);
  },
  //活动的角标
  getAllGameActRewardNum(): Promise<{ list: GameActRewardNumRes[] }> {
    return Axios.post("/hall/v1/act/getAllGameActRewardNum");
  },
  //获取消息的个数
  getMsgNoticeNum(): Promise<{ code: number; msg: string; total: number }> {
    return Axios.post("/hall/v1/user/getMsgNoticeNum");
  },
  //登录判断pwa和apk环境登录账号领取
  getReceivePwaReward(parems: { mac: string; type: number }) {
    return Axios.post("/hall/v1/act/receivePwaReward", parems);
  },
  //获取安装引导配置接口
  getInstallGuideConfig(parems: {
    advStr: string;
    uid: number;
  }): Promise<GetInstallGuideConfigRes> {
    return Axios.post("/hall/v1/settings/getInstallGuideConfig", parems);
  },
  //事件上报
  setReportEvent(parems: { advid: string; eventName: string; os: string; uniqid: string }) {
    return Axios.post("/hall/v1/settings/setReportEvent", parems);
  },
  //游戏分组
  getGroupClusters(): Promise<{ list: GetgroupClustersRes[] }> {
    return Axios.post("/hall/v1/game/group/list");
  },
  //游戏收藏
  clickCollect(parems: { collectType: string; gameId: number }) {
    return Axios.post("/hall/v1/game/collect", parems);
  },
  //获取游戏全部的列表
  getGameListAll(parems: {
    pageNo: number;
    pageSize: number;
  }): Promise<{ list: []; total: number }> {
    return Axios.post("/hall/v1/game/games/list", parems);
  },
};
